from sqlalchemy.orm import Session
from sqlalchemy import text
from app.entity import SysUser
from app.schema import UserLogin, UserLogin
from utils.string import StringUtil

class AuthModel:
    """
    菜单管理模块数据库操作层
    """
    @classmethod
    def login(
        cls, 
        username:str,
        password:str,
        db: Session
    ) -> bool :
        user = db.query(SysUser). \
            filter(
                SysUser.user_name==username,
                SysUser.password==password
            ).first()
        
        return user
